#define DEBUG
#include <cstdio>
#define MAXN 100000
#define MAXTOT 500000
#define MODS 998244353

using namespace std;

long long qpower(long long a, int n) {
  long long ret=a, s=1;
  for (; n>1; n/=2) {
    if (n%2) {
      s = s*ret%MODS;
    }
    ret = ret*ret%MODS;
  }
  return ret*s%MODS;
}

int main() {
#ifdef DEBUG
  freopen("0.in", "r", stdin);
  freopen("0.out", "w", stdout);
#endif

  static int a[MAXN+1];
  static long long fact[MAXTOT+1], unfact[MAXTOT+1];
  int n, tot=0;
  scanf("%d", &n);
  for (int i=1; i<=n; i++) {
    scanf("%d", a+i);
    tot+=a[i];
  }
  fact[0]=1;
  for (int i=1; i<=tot; i++) {
    fact[i] = fact[i-1]*i%MODS;
  }
  unfact[tot]=qpower(fact[tot], MODS-2);
  for (int i=tot; i>0; i--) {
    unfact[i-1] = unfact[i]*i%MODS;
  }
  long long ans=1;
  for (int i=n; i>0; i--) {
    ans = ans*(fact[tot-1]*unfact[a[i]-1]%MODS*unfact[tot-a[i]]%MODS)%MODS;
    tot -= a[i];
  }

  printf("%lld", ans);

  fclose(stdin);
  fclose(stdout);
  return 0;
}
